package com.csair.seam.domain.model.entity;

import com.csair.seam.infrastructure.poi.annotation.ExportField;
import com.csair.seam.infrastructure.poi.annotation.ImportField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel
public class IdleReceiveExecl {

    @ExportField(columnName = "原公司")
    @ImportField(name = "原公司")
    @ApiModelProperty(value="原公司")
    private String outcorp;

    @ImportField(name = "接收公司")
    @ExportField(columnName="接收公司")
    @ApiModelProperty(value="接收公司")
    private String incorp;

    @ImportField(name = "接收使用部门")
    @ExportField(columnName="接收使用部门")
    @ApiModelProperty(value="接收使用部门")
    private String indept;

    @ImportField(name = "处置方式")
    @ExportField(columnName="处置方式")
    @ApiModelProperty(value="处置方式")
    private String intype;

    @ImportField(name = "设备大类")
    @ExportField(columnName="设备大类")
    @ApiModelProperty(value="设备大类")
    private String category;

    @ImportField(name = "成交日期")
    @ExportField(columnName="成交日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value="成交日期")
    private Date dealDate;

    @ImportField(name = "交易总额（元）")
    @ExportField(columnName="交易总额（元）")
    @ApiModelProperty(value="交易总额（元）")
    private BigDecimal insum;

    @ImportField(name = "交易数量")
    @ExportField(columnName="交易数量")
    @ApiModelProperty(value="交易数量")
    private Integer receivnum;

    public IdleReceiveExecl(IdleReceive idleReceive){
        outcorp = idleReceive.getOutcorp();
        incorp  = idleReceive.getIncorp();
        indept  = idleReceive.getIndept();
        intype  = idleReceive.getIntype();
        receivnum = idleReceive.getReceivnum();
        insum = idleReceive.getInsum();
        dealDate = idleReceive.getDealDate();
        category = idleReceive.getCategory();
    }
    public IdleReceiveExecl(String incorp,Integer receivnum,String category){
        this.incorp = incorp;
        this.receivnum = receivnum;
        this.category = category;
    }
}
